export default{
    /**
     *  表格下载方法
     * @param { 下文件名} filename 
     * @param {文件流} res 
     */
     download(filename,res){
       var type="application/vnd.ms-excel;charset=utf-8"
        let file = new Blob([res], {
          type: type,
        });
        if (window.navigator.msSaveOrOpenBlob) {
          // IE10+
          window.navigator.msSaveOrOpenBlob(file, filename);
        } else {
          // Others
          let a = document.createElement("a");
          let url = URL.createObjectURL(file);
          a.href = url;
          a.download = filename+".xlsx";
          document.body.appendChild(a);
          a.click();
          setTimeout(() => {
            document.body.removeChild(a);
            window.URL.revokeObjectURL(url);
          }, 0);
        }
     }
}